@extends('common.admin_template')

@section('content')
    <section class="content">
        <div class="row">
        <div class="col-md-3 col-sm-6 col-xs-12">
            <div class="info-box">
                <span class="info-box-icon bg-aqua"><i class="fa fa-user"></i></span>

                <div class="info-box-content">
                    <span class="info-box-text">个人用户</span>
                    <span class="info-box-number">{{$num[0]}}</span>
                </div>
                <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
        </div>
        <!-- /.col -->
        <div class="col-md-3 col-sm-6 col-xs-12">
            <div class="info-box">
                <span class="info-box-icon bg-red"><i class="fa fa-sitemap"></i></span>

                <div class="info-box-content">
                    <span class="info-box-text">企业用户</span>
                    <span class="info-box-number">{{$num[1]}}</span>
                </div>
                <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
        </div>
        <!-- /.col -->

        <!-- fix for small devices only -->
        <div class="clearfix visible-sm-block"></div>

        <div class="col-md-3 col-sm-6 col-xs-12">
            <div class="info-box">
                <span class="info-box-icon bg-green"><i class="fa fa-calendar"></i></span>

                <div class="info-box-content">
                    <span class="info-box-text">发布活动</span>
                    <span class="info-box-number">{{$num[2]}}</span>
                </div>
                <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
        </div>
        <!-- /.col -->
        <div class="col-md-3 col-sm-6 col-xs-12">
            <div class="info-box">
                <span class="info-box-icon bg-yellow"><i class="fa fa-star"></i></span>

                <div class="info-box-content">
                    <span class="info-box-text">用户申请</span>
                    <span class="info-box-number">{{$num[3]}}</span>
                </div>
                <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
        </div>
        <!-- /.col -->
    </div>
        <div class="row">
            <!-- Left col -->
            <div class="col-md-8">

                <!-- TABLE: LATEST ORDERS -->
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">热门游览</h3>

                        <div class="box-tools pull-right">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                            </button>
                            <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                        </div>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body" style="display: block;">
                        <div class="table-responsive">
                            <table class="table no-margin">
                                <thead>
                                <tr>
                                    <th>排名</th>
                                    <th>标题</th>
                                    <th>游览量</th>
                                    <th>收藏量</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php $i=1; ?>
                                @foreach($news as $n)
                                <tr>
                                    <td>{{$i}}</td>
                                    <td>{{$n->title}}</td>
                                    <td>{{$n->view}}</td>
                                    <td>{{$n->keep}}</td>
                                </tr>

                                <?php $i++; ?>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                        <!-- /.table-responsive -->
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->

            <div class="col-md-4">

                <!-- PRODUCT LIST -->
                <div class="box box-danger">
                    <div class="box-header with-border">
                        <h3 class="box-title">最新用户</h3>
                        <div class="box-tools pull-right">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                            </button>
                            <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i>
                            </button>
                        </div>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding" style="display: block;">
                        <ul class="users-list clearfix">
                            @foreach($user as $u)
                            <li>
                                <div class="users-list-Box"><img src="{{$u->avatar}}" alt="User Image"></div>
                                <a class="users-list-name" href="{{asset("/admin/user/edit/".$u->id)}}">{{$u->name}}</a>
                                <span class="users-list-date">{{$u->time}}</span>
                            </li>
                            @endforeach
                        </ul>
                        <!-- /.users-list -->
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer text-center" style="display: block;">
                        <a href="{{asset("/admin/users")}}" class="uppercase">查看所有用户</a>
                    </div>
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
    </section>
@stop
@section('js')
@stop